package com.dense.kuiniu.bookborrow.business.adapter;


import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.dense.kuiniu.bookborrow.R;
import com.dense.kuiniu.bookborrow.business.entity.NumberBean;

import java.util.List;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

/**
 * @author Administrator
 * @date 2019/12/11
 */
public class NumberAdapter extends BaseQuickAdapter<NumberBean, BaseViewHolder> {
    public NumberAdapter(int layoutResId, @Nullable List<NumberBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, NumberBean item) {
        helper.setText(R.id.tv_number, item.getName());
        if (item.getType() == 0) {
            helper.setBackgroundResource(R.id.tv_number, R.drawable.shape_bg_item_number_blue);
        } else {
            helper.setBackgroundResource(R.id.tv_number, R.drawable.shape_bg_item_number_yellow);
        }
    }
}
